home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
dec92.zip
/
1012074A
< prev
next >
Wrap
Text File
|
1992-10-13
|
398b
|
23 lines
/* find1.c: Extract lines from a file */
#include <stdio.h>
#include <string.h>
#define WIDTH 128
main(int argc, char *argv[])
{
char line[WIDTH];
char *search_str;
if (argc == 1)
return 1; /* Search string required */
search_str = argv[1];
while (gets(line))
if (strstr(line,search_str))
puts(line);
return 0;
}